export class Cancel {
  message:string = ''
}

export class CancelToken {
  resolvePromise:Function|null = null
  promise = new Promise(resolve=>this.resolvePromise=resolve)
  
  constructor(executor:(cancel:(msg?:string)=>void)=>void){
    executor(message=>{
      this.resolvePromise?.()
    })
  }
}


